#ifndef BINARYREADER_H_
#define BINARYREADER_H_

#include <stdint.h>
#include "FileInterface.h"

namespace opennav {

class BinaryReader {
public:
	BinaryReader(FileInterface* file);

	bool read(void* ptr, int32_t len);

	int32_t read_int32();
	bool read_int32(int32_t& val);
	int32_t read_int24();
	bool read_int24(int32_t& val);
	int16_t read_int16();
	bool read_int16(int16_t& val);
	int8_t read_int8();
	bool read_int8(int8_t& val);
	uint32_t read_uint32();
	bool read_uint32(uint32_t& val);
	int32_t read_uint24();
	bool read_uint24(int32_t& val);
	uint16_t read_uint16();
	bool read_uint16(uint16_t& val);
	uint8_t read_uint8();
	bool read_uint8(uint8_t& val);

private:
	FileInterface* file_;
};

}

#endif /* BINARYREADER_H_ */
